<?php
/**
 *
 * PHP 5
 *
 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
 * Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
 *
 * Licensed under The MIT License
 * Redistributions of files must retain the above copyright notice.
 *
 * @copyright     Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
 * @link          http://cakephp.org CakePHP(tm) Project
 * @package       Cake.View.Layouts
 * @since         CakePHP(tm) v 0.10.0.1076
 * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
 */
?>
<!DOCTYPE html>
<html>
    <head>
        <?php echo $this->Html->charset(); ?>
        <title>
            <?php echo $title = "Core :: {$moduleName} :: " . ucwords(str_replace(array("block_", "_"), array("", " "), $methodName)) . ""; ?>
        </title>
        <?php
        echo $this->Html->meta('icon');
        echo $this->Html->css('white');
        echo $this->Html->css('../js/jquery-easyui/themes/gray/easyui');
        echo $this->Html->css('../js/jquery-easyui/themes/icon');
        echo $this->Html->css('coreIcons');

        //echo $this->Html->script('jquery-easyui/jquery-1.8.0.min');
        echo $this->Html->script('jquery-2.0.2.min');
        //echo $this->Html->script('jquery-easyui/jquery.min');
        echo $this->Html->script('jquery-easyui/jquery.easyui.min');
        echo $this->Html->script('jquery-easyui/locale/easyui-lang-pt_BR');
        echo $this->Html->script('jquery-easyui/easyloader');
        echo $this->Html->script('core');

        echo $this->fetch('meta');
        echo $this->fetch('css');
        echo $this->fetch('script');

        $ckeditor = Configure::read('CKEDITOR');
        if (!empty($ckeditor)) {
            echo $this->Html->script('ckeditor/ckeditor');
            echo $this->Html->script('ckfinder/ckfinder');
        }

        if ($methodName == 'dataGrid') {
            echo $this->Html->css('dataGrid');
            echo $this->Html->script('dataGrid');
        } else {
            echo $this->Html->css('cake.generic');
        }
        ?>
        <script>
            $(function() {
                $('div#divLoader').window({
                    width: 300,
                    height: 100,
                    modal: true,
                    closed: true,
                    closable: false,
                    maximizable: false,
                    minimizable: false,
                    collapsible: false
                });
                $('body').layout();
                $('body').layout('collapse', 'south');
                $('body').layout('collapse', 'east');
                //$('body').layout('collapse','west');
            })
        </script>
    </head>
    <body>
        <div region="north" border="false" style="height:60px; overflow: hidden;">
            <?php echo implode("", $blocks['t']); ?>
        </div>
        <div region="west" split="true" title="" style="width:200px;"><?php echo implode("", $blocks['l']); ?></div>
        <div region="east" split="true" collapsible="true" title="" style="width:200px;"><?php echo implode("", $blocks['r']); ?></div>
        <div region="south" border="false" title="" style="height:50px;">  

            <div id="bottom">

            </div>
            <?php echo implode("", $blocks['b']); ?>
        </div>
        <?php
        $title = $moduleName;
        if (!empty($methodName)) {
            //$title = "<a href=\'{$this->Html->url(array('controller' => $moduleName, 'action'=>'index'))}\'>{$moduleName}</a> :: <div class=\'icon-{$this->Html->getBlockIcon($moduleName, $methodName)}\' style=\'display:inline;padding-left:20px;height:16px;\' >$methodName</div>";
            $title = "{$moduleName} :: <div class=\'icon-{$this->Html->getBlockIcon($moduleName, $methodName)}\' style=\'display:inline;padding-left:20px;height:16px;\' >" . ucwords(str_replace(array("block_", "_"), array("", " "), $methodName)) . "</div>";
        }
        ?>
        <div region="center" id="layoutCenter" <?php if ($moduleName != 'pages') { ?>data-options="iconCls:'icon-<?php echo $this->Html->getModuleIcon($moduleName); ?>',title:'<?php echo $title; ?>'"<?php } ?>>
            <?php echo $this->Session->flash(); ?>

            <?php echo $this->fetch('content'); ?>
            <?php echo implode("", $blocks['c']); ?>
        </div> 
        <?php //echo $this->element('sql_dump'); ?>
        <div id="divLoader" iconCls="icon-disc-blue" title="Loading" >  
            <div class="loader"></div>
        </div>
    </body>
</html>